home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / nrpas13.zip / FLEG.DEM < prev    next >
Text File  |  1991-04-29  |  717b  |  34 lines

  1. PROGRAM d14r7(input,output);
  2. (* driver for routine FLEG *)
  3. CONST
  4.    nval=5;
  5.    dx=0.2;
  6.    npoly=5;
  7. TYPE
  8.    glnlarray = ARRAY [1..npoly] OF real;
  9. VAR
  10.    i,j : integer;
  11.    x : real;
  12.    afunc : glnlarray;
  13.  
  14. (*$I MODFILE.PAS *)
  15. (*$I PLGNDR.PAS *)
  16.  
  17. (*$I FLEG.PAS *)
  18.  
  19. BEGIN
  20.    writeln;
  21.    writeln('legendre polynomials':43);
  22.    writeln('n=1':9,'n=2':10,'n=3':10,'n=4':10,'n=5':10);
  23.    FOR i := 1 to nval DO BEGIN
  24.       x := i*dx;
  25.       fleg(x,afunc,npoly);
  26.       writeln('x  := ',x:6:2);
  27.       FOR j := 1 to npoly DO write(afunc[j]:10:4);
  28.       writeln('  routine FLEG');
  29.       FOR j := 1 to npoly DO write(plgndr(j-1,0,x):10:4);
  30.       writeln('  routine PLGNDR');
  31.       writeln
  32.    END
  33. END.
  34.